package com.ionehe.group.common.uaa.ex.enums;

import java.util.Objects;

/**
 * Copyright (c) 2020 ionehe.com
 * Date: 2020/10/10
 * Time: 下午3:08
 *
 * @author 2020年 <a href="mailto:a@ionehe.com">秀</a>
 */
public enum AdminType {
    /**
     * 平台管理员
     */
    PLATFORM_ADMIN(false, "平台管理员"),
    /**
     * 开发者
     */
    DEVELOPER(true, "开发者");

    private Boolean value;

    private String des;

    AdminType(Boolean value, String des){
        this.value = value;
        this.des = des;
    }

    public static AdminType from(Boolean value) {
        if (value == null) {
            return null;
        }
        for (AdminType status : AdminType.values()) {
            if (Objects.equals(value, status.getValue())) {
                return status;
            }
        }
        return null;
    }

    public Boolean getValue() {
        return value;
    }

    public String getDes() {
        return des;
    }
}
